Accusoft.BarcodeXpress12.Net - Updated
Write a Data Matrix Barcode
User Guide > How To > Create a Barcode > Create a 2D Barcode > Write a Data Matrix Barcode

Use the code example below as a guideline for writing Data Matrix barcodes.

C# - Basic steps for barcode writing Data Matrix Barcodes using Accusoft.BarcodeXpress.Net
Copy Code
//create and unlock the BarcodeXpress component
BarcodeXpress bcx = new BarcodeXpress();
// The SetSolutionName and SetSolutionKey methods must be called to distribute the runtime.
bcx.Licensing.SetSolutionName("YourSolutionName");
bcx.Licensing.SetSolutionKey(12345,12345,12345,12345);
// The SetOEMLicenseKey method is required if Manually Reported Runtime Licensing is used.
bcx.Licensing.SetOEMLicenseKey("1.0.AStringForOEMLicensing");
//Create the writer Data Matrix class
WriterDataMatrix dataMatrix = new WriterDataMatrix(bcx);
// Set the text value
dataMatrix.BarcodeValue = "DataMatrix Value";
//call Create and get resulting image
if (imageXView1.Image != null)
   imageXView.Image.Dispose();
imageXView1.Image = Accusoft.ImagXpressSdk.ImageX.FromHdib(imagXpress1, dataMatrix.Create(), true);
// dispose of the writer Data Matrix and barcode component
dataMatrix.Dispose();
bcx.Dispose();